class MedcaresController < ApplicationController
  # GET /medcares
  # GET /medcares.xml
  def index
    @medcares = Medcare.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @medcares }
    end
  end

  # GET /medcares/1
  # GET /medcares/1.xml
  def show
    @medcare = Medcare.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @medcare }
    end
  end

  # GET /medcares/new
  # GET /medcares/new.xml
  def new
    @medcare = Medcare.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @medcare }
    end
  end

  # GET /medcares/1/edit
  def edit
    @medcare = Medcare.find(params[:id])
  end

  # POST /medcares
  # POST /medcares.xml
  def create
    @medcare = Medcare.new(params[:medcare])

    respond_to do |format|
      if @medcare.save
        flash[:notice] = 'Medcare was successfully created.'
        format.html { redirect_to(@medcare) }
        format.xml  { render :xml => @medcare, :status => :created, :location => @medcare }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @medcare.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /medcares/1
  # PUT /medcares/1.xml
  def update
    @medcare = Medcare.find(params[:id])

    respond_to do |format|
      if @medcare.update_attributes(params[:medcare])
        flash[:notice] = 'Medcare was successfully updated.'
        format.html { redirect_to(@medcare) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @medcare.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /medcares/1
  # DELETE /medcares/1.xml
  def destroy
    @medcare = Medcare.find(params[:id])
    @medcare.destroy

    respond_to do |format|
      format.html { redirect_to(medcares_url) }
      format.xml  { head :ok }
    end
  end
end
